package com.liguangting.agentsflex.tool;

import com.agentsflex.core.functions.annotation.FunctionDef;
import com.agentsflex.core.functions.annotation.FunctionParam;


/**
 * @author liguangting
 * @date 2024/7/10
 * @description
 */
public class TestTools {

    @FunctionDef(name = "add", description = "两个整数相加")
    public static int add(@FunctionParam(name = "a", description = "一个整数")int a, @FunctionParam(name = "b", description = "一个整数")int b) {
        return a + b;
    }

    @FunctionDef(name = "multiply", description = "两个整数相乘")
    public static int multiply(@FunctionParam(name = "a", description = "一个整数")int a, @FunctionParam(name = "b", description = "一个整数")int b) {
        return a * b;
    }

    @FunctionDef(name = "getUserName", description = "根据用户ID获取用户名")
    public static String getUserName(@FunctionParam(name = "userId", description = "用户ID")int userId) {
        if (userId < 100) {
            return "张三";
        } else if (userId < 10000) {
            return "李四";
        } else {
            return "王五";
        }
    }
}
